-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MIDI port listing #97
base: master
Are you sure you want to change the base?
Conversation
Did you forgot change midi_win32.cpp? |
I sure did. I’ll get that revised when I get a chance. |
I have not tested the previous commit as I'm struggling to build this on Windows (I've never done Windows C++ development before and cannot figure out how to install SDL2.) Can you either test that for me, or give me some help on how to install SDL2? |
I had a look at the windows code. There are some issues. #include <windows.h> needs to be lowercase (pre-existing issue) midiInGetID(midi_handle, puDeviceId); printf("Port[%u]: %s\n", i, puDeviceId); |
Maybe a helpful reference: |
Thank you for looking into this! That means that I didn’t do what I had intended. I’m trying to print a named descriptor of the MIDI device (see the rtmidi implementation in this PR) to print out. All of Microsoft’s types are throwing me for a loop as someone unfamiliar with the win32 API. |
It seems like to get a device name, I should have used this: https://learn.microsoft.com/en-us/windows/win32/api/mmeapi/nf-mmeapi-midiingetdevcaps @Gerwin2k can you give me a tip on how to install SDL2? I’m using Visual Studio 2022 to build because I don’t know anything about the C++ build process on Windows (I’m only familiar with *nix systems). If you can point me to a better resource, I can use that instead. |
I don't use any recent MSVC. Instead I use MinGW with Code::Blocks IDE. Note that Nuked-SC55 already reports the Midi port description string in the console, but only for the single port that it is using. |
I just committed a fix for my previous commit that copies the behavior of what you described. I'm still struggling to get MinGW running and won't have time to check this tonight, but since it's a copy/paste job, I imagine there shouldn't be an issue. If nobody is free to check this today, I can get back to creating a Windows build environment tomorrow to check my work. Thank you again for all your help! |
That’s the behavior I expect! Thanks again for all of your help. |
@graysonguarino a guide to compiling on Windows with Visual Studio: #44 (comment) |
Adds an option
-pl
to list MIDI ports.When testing this emulator, I was struggling to tell what my MIDI ports were as I have multiple MIDI devices plugged in, some with multiple ports. This helped me determine the one I wished to use.